package com.central.consume.model;

import lombok.Data;

import java.util.Date;

import static org.apache.commons.lang3.time.DateUtils.isSameDay;

@Data
public class ChargeDO {
    // 玩家ID
    private Long id;
    // 首冲时间
    private Date firstChargeTime;
    // 最近一次充值时间
    private Date lastChargeTime;

    public void setLastChargeTime(Date lastChargeTime) {
        if (!isSameDay(lastChargeTime,new Date())){
            setDayCharge(0D);
        }
        this.lastChargeTime = lastChargeTime;
    }

    // 总充值金额
    private Double total;
    // 今日充值金额
    private Double dayCharge;
//    public void setDayCharge(Double dayCharge) {
//        if (isSameDay(getFirstChargeTime(),new Date())){
//            this.dayCharge = dayCharge;
//        }else {
//            this.dayCharge = 0D;
//        }
//    }

}
